from proto.user import user_pb2, user_pb2_grpc
import grpc

# request = user_pb2.HelloRequest()
#
# request.name = "SongYu"
#
# res_str = request.SerializeToString()
# print(res_str)
#
#
# request2 = user_pb2.HelloRequest()
# request2.ParseFromString(res_str)
# print(request2.name)

if __name__ == '__main__':
    with grpc.insecure_channel("localhost:8080") as ch:
        stub = user_pb2_grpc.GreeterStub(ch)
        rsp: user_pb2.HelloReply = stub.SayHelloAgain(user_pb2.HelloRequest(name="SongYu"))
        print(rsp.message)